package com.hzw.service.impl;

import com.hzw.bean.User;
import com.hzw.dao.UserMapper;
import com.hzw.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Created by Administrator on 2019/2/26.
 */
@Service
public class UserServiceImpl implements UserService{
    @Resource
    private UserMapper userMapper;

    @Override
    @Transactional(rollbackFor = Exception.class)
    public void addUser() {
//        User user = new User("123","hzw","666");
//        userMapper.insertSelective(user);
//        User user1 = new User("123","hzw","666");
//        userMapper.insertSelective(user1);
    }

    @Override
    public int checkExistUserName(String userName) {
        return userMapper.checkExistUserName(userName);
    }

    @Override
    public int checkPassword(User user) {
        return userMapper.checkPassword(user);
    }
}
